<?php

namespace plugin\ycMassage\app\validate;

use think\Validate;


class MassageMch extends Validate
{
    public $rule =   [
        'title' => 'require',
        'logo' => 'require',
        'province_id' => 'require',
        'city_id' => 'require',
        'area_id' => 'require',
        'address' => 'require',
        'name' => 'require',
        'mobile' => 'require|mobile',
        'regions' => 'require|array|length:3,4',
        'tel' => 'require|array|length:2,3'
    ];

    protected $message  =   [
        'title.require' => '商户名称必须',
        'logo.require' => '请上传logo',
        'province_id.require' => '请选择入驻城市',
        'city_id.require' => '请选择入驻城市',
        'area_id.require' => '请选择入驻城市',
        'address.require' => '详细地址必须',
        'name.require' => '负责人姓名必须',
        'mobile.require' => '负责人手机号必须',
        'mobile.mobile' => '负责人手机号格式不正确',
        'regions.require' => '请选择入驻区域',
        'regions.array' => '请选择入驻区域',
        'regions.length' => '请选择入驻区域',
        'tel.require' => '请填写联系电话',
        'tel.array' => '请填写联系电话',
        'tel.length' => '联系电话至少填写两个号码',
    ];
    protected $scene = [
        'apply' => ['title', 'logo', 'province_id', 'city_id', 'area_id', 'address', 'name', 'mobile', 'tel'],
        'admin_create' => ['title', 'logo', 'address', 'name', 'mobile', 'regions', 'tel'],
        'admin_update' => ['title', 'logo', 'address', 'name', 'mobile', 'regions', 'tel'],
    ];
}
